package com.admin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.admin.domain.RoleMenuDO;

/**
 * 角色菜单mapper
 * 
 * @author ZY
 * @date 2018/12/06
 */
public interface RoleMenuMapper extends BaseMapper<RoleMenuDO> {

    /**
     * 查询角色关联的菜单
     * 
     * @param roleId
     * @return
     */
    public List<Long> selectMenuIdByRoleId(Long roleId);

    /**
     * 查询一组角色关联的菜单
     * 
     * @param roleIds
     * @return
     */
    public List<Long> selectMenuIdByRoleIds(List<Long> roleIds);

    /**
     * 批量新增
     * 
     * @param list
     * @return
     */
    public int insertBatch(List<RoleMenuDO> list);

    /**
     * 删除角色的一组菜单
     * 
     * @param roleId
     * @param menuIds
     * @return
     */
    public int deleteByRoleMenuId(@Param(value = "roleId") Long roleId, @Param(value = "menuIds") List<Long> menuIds);

    /**
     * 删除角色关联的菜单
     * 
     * @param roleId
     * @return
     */
    public int deleteByRoleId(Long roleId);

    /**
     * 删除一组角色关联的菜单
     * 
     * @param roleIds
     * @return
     */
    public int deleteByRoleIds(List<Long> roleIds);

    /**
     * 删除菜单对应的关联
     * 
     * @param menuId
     * @return
     */
    public int deleteByMenuId(Long menuId);

    /**
     * 删除一组菜单对应的关联
     * 
     * @param menuIds
     * @return
     */
    public int deleteByMenuIds(List<Long> menuIds);
}